<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML >
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'Image.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
    <link rel="stylesheet" type="text/css" href="UI/admins/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="UI/admins/css/main.css"/>
    <style type="text/css">body{text-align:center}.exp1{font-size:170%;}</style>
  </head>
  
  <body>
  	<span id='div1'><img id="erweima" name="erweima" src="<%=request.getContextPath()%><s:property value="path"/>"></img>
  	<br><div class="exp1"><strong>订单号：<s:property value="ordertable.orderId"/>
  	<br>终端地址：<s:property value="ordertable.machine.machineaddress.machineaddress.name"/>____<s:property value="ordertable.machine.machineaddress.name"/>
  	<br>收件人电话：<s:property value="ordertable.receiverPhone"/></strong></div>
  	</span><br>
  	<a  class="btn btn-primary btn6 mr10"  onclick="javascript:printit('div1');">打印</a>
  	<s:if test="#session.role!=null">
  	<a  class="btn btn6" href="listAllOrdertable">下次</a>
	</s:if>
	<s:else>
	<a  class="btn btn6" href="listAllOrdertableUser">下次</a>
	</s:else>
  	<script src="UI/admins/js/libs/jquery.js"></script>
  	<script type="text/javascript" language="javascript">
  	
$(document).ready(function(){
	$.post("showImage.action",function(data){      //data代表服务器端传来的数据
		//alert(data+${ordertable.orderId}+".jpg");
		var pic = document.getElementById("erweima");
		//pic.src=data+${ordertable.orderId}+".jpg";
	});
	
	
});
</script>
	<script type="text/javascript" language="javascript">
		//提示窗口 
		function printit(MyDiv) {
			if (confirm('确定打印吗？')) {
				//var newstr = document.all.item(myDiv).innerHTML;               
				var newstr =document.getElementById(MyDiv).innerHTML; 
				//alert(newstr); 
				var oldstr = document.body.innerHTML;
				document.body.innerHTML = newstr;
				window.print();
				document.body.innerHTML = oldstr;
				return false;
			}
		}
	
		
	</script>

</body>
  
</html>
